package de.hska.algo.labor2010.strecken;

import java.util.ArrayList;
import java.util.List;

import junit.framework.Assert;

import org.junit.Test;

public class IntersectLinesTest {

	@Test
	public void testBruteForceIntersect() {

		ArrayList<Line> lines = new ArrayList<Line>();
		lines.add(new Line(1.0, 1.0, 1.0, 5.0));
		lines.add(new Line(0.0, 2.0, 5.0, 2.0));
		lines.add(new Line(1.0, 4.0, 3.0, 2.0));
		lines.add(new Line(50.0, 50.0, 51.0, 51.0));
		IntersectLinesBruteForce intersect = new IntersectLinesBruteForce();
		List<Point> intersections = intersect
				.bruteForceIntersect(lines);
		Assert.assertEquals(1.0, intersections.get(0).getX(), 1.9e-16);
		Assert.assertEquals(2.0, intersections.get(0).getY(), 1.9e-16);
		Assert.assertEquals(1.0, intersections.get(1).getX(), 1.9e-16);
		Assert.assertEquals(4.0, intersections.get(1).getY(), 1.9e-16);
		Assert.assertEquals(3.0, intersections.get(2).getX(), 1.9e-16);
		Assert.assertEquals(2.0, intersections.get(2).getY(), 1.9e-16);

	}
	@Test
	public void testBruteForceIntersectEmpty(){
		//ArrayList<Line> lines = new Zeugs und so 
	}

	

}
